import computed from "./computed.js";
import ref from "./ref.js";
import reactive from "./reactive.js";
import { effect } from "./effect.js";
const state = ref(0);
const state2 = reactive({ a: 1, b: 2 });

const state3 = computed({
  get: () => {
    const res = state.value + state2.a;
    return res;
  },
});

// console.log(state3.value);
// console.log(state3.value);
// console.log(state3.value);
// console.log(state3.value);
// console.log(state3.value);
// console.log(state3.value);

effect(() => {
  console.log("test fn");
  console.log(state3.value);
  console.log("-------------------------------------");
  console.log(state3.value);
  console.log("-------------------------------------");
  console.log(state3.value);
  console.log("-------------------------------------");
  console.log(state3.value);
  console.log("-------------------------------------");
  console.log(state3.value);
  console.log("-------------------------------------");
  console.log(state3.value);
  console.log("-------------------------------------");
});

// state.value = 1;
// state2.a = 2;
// state.value = 3;
// state3.value = 3;
state.value = 4;
console.log("-------------------------------------");
state2.a = 3;
console.log("-------------------------------------");
// state3.value = 9;
// console.log("-------------------------------------");
